package pe.com.bbva.efcap.servidor.util;

import java.net.MalformedURLException;

import org.springframework.stereotype.Repository;

import pe.com.grupobbva.grec.pe21.CtConGrecPe21Rq;
import pe.com.grupobbva.grec.pe21.CtConGrecPe21Rs;
import pe.com.grupobbva.grec.pe21.PE21Service;
import pe.com.grupobbva.grec.pe21.PE21ServiceImpl;

@Repository
public class PE21ServiceUtil {
	
	private String wsdlLocation;
	
	public PE21ServiceUtil() throws MalformedURLException{		
		wsdlLocation = Utilitarios.obtenerParametro("pe21.url.wsdlLocation");
	}

	public CtConGrecPe21Rs llamarPE21(CtConGrecPe21Rq ctConGrecPe21Rq) throws MalformedURLException{
		PE21Service pe21Service = new PE21ServiceImpl(wsdlLocation);
		CtConGrecPe21Rs rs = pe21Service.getGRECPE21PortTypeImplPort().callPE21(ctConGrecPe21Rq);
		return rs;
	}
}
